package com.linkage.event.feign.usercenter;

import com.linkage.common.base.RequestInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

@FeignClient(name = "UserCenterService",url="${feign.usercenterServiceurl}/exter", fallback = UserCenterServiceFeignFallBack.class)
public interface UserCenterFeign {

    /**
     * 获取上级管理员用户
     * @param query
     * @return
     */
    @RequestMapping(value = "/manage/getSuperiorManager", method = RequestMethod.POST)
    String getSuperiorManager(@RequestBody RequestInfo<Map<String, String>> query);

    /**
     * 获取用户信息
     * @param query
     * @return
     */
    @RequestMapping(value = "/manage/getUserMgInfoVO", method = RequestMethod.POST)
    String getUserMgInfoVO(@RequestBody RequestInfo<Map<String, String>> query);

}


@Component
class UserCenterServiceFeignFallBack implements UserCenterFeign{


    @Override
    public String getSuperiorManager(RequestInfo<Map<String, String>> query) {
        return null;
    }

    @Override
    public String getUserMgInfoVO(RequestInfo<Map<String, String>> query) {
        return null;
    }
}